<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    ul li {
        list-style: none;
    }
    .item{
        width: 100px;
        height: 40px;
        background: pink;
        border:1px solid rgb(242,102,13);
        text-align: center;
        line-height: 40px;
        float: left;
    }
    .clearfix{
        clear: both;
    }

    /* 1 */
     /* .clearfix{
        clear: both;
    } */

    /* 2 */
    /* .list::after{
        content: '';
        display: block;
        clear: both;
    } */
   
</style>
<body>
    <ul class="list">
        <li class="item">1</li>
        <li class="item">2</li>
        <li class="item">3</li>
        <li class="item">4</li>
        <li class="item">5</li>
        <li class="clearfix"></li>
    </ul>
    <div class="test">hello world</div>
</body>
</html>